#include "MainWindow.h"
#include "ui_MainWindow.h"

void MainWindow::on_chooseDm_clicked()
{
    dc=new drumChoose(0,this);
    dc->show();
}

void MainWindow::on_Playerbtn_clicked()
{
    pl=new Player(0);
    pl->show();
}

void MainWindow::on_drum1_pressed()
{
    QMediaPlayer *player=new QMediaPlayer;
    switch(drumset){
    case 1:{
         player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum1.wav")));
         break;
    }
    case 2:{
        player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum1_2.wav")));
        break;
    }
    }
    player->play();
    ui->drum1->setStyleSheet("border-image: url(:/pic/pic/drun1_2.png);border-radius: 10px;");//文件名drum拼错了...
}


void MainWindow::on_drum1_released()
{
    ui->drum1->setStyleSheet("border-image: url(:/pic/pic/drum1.png);border-radius: 10px;");
}


void MainWindow::on_drun4_released()
{
    ui->drun4->setStyleSheet("border-image: url(:/pic/pic/drum4.png);border-radius: 10px;");
}


void MainWindow::on_drun4_pressed()
{
    QMediaPlayer *player=new QMediaPlayer;
    switch(drumset){
    case 1:{
         player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum4.wav")));
         break;
    }
    case 2:{
        player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum4_2.wav")));
        break;
    }
    }
    player->play();

    ui->drun4->setStyleSheet("border-image: url(:/pic/pic/drum4_2.png);border-radius: 10px;");
}


void MainWindow::on_drum2_pressed()
{
    QMediaPlayer *player=new QMediaPlayer;
    switch(drumset){
    case 1:{
         player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum2.wav")));
         break;
    }
    case 2:{
        player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum2_2.wav")));
        break;
    }
    }
    player->play();
    ui->drum2->setStyleSheet("border-image: url(:/pic/pic/drum2_2.png);border-radius: 10px;");

}


void MainWindow::on_drum2_released()
{
    ui->drum2->setStyleSheet("border-image: url(:/pic/pic/drum2.png);border-radius: 10px;");
}

void MainWindow::on_drum3_pressed()
{
    QMediaPlayer *player=new QMediaPlayer;
    switch(drumset){
    case 1:{
         player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum3.wav")));
         break;
    }
    case 2:{
        player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum3_2.wav")));
        break;
    }
    }
    player->play();
    ui->drum3->setStyleSheet("border-image: url(:/pic/pic/drum3_2.jpg);border-radius: 10px;");
}


void MainWindow::on_drum5_pressed()
{
    QMediaPlayer *player=new QMediaPlayer;
    switch(drumset){
    case 1:{
         player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum5.wav")));
         break;
    }
    case 2:{
        player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum5_2.wav")));
        break;
    }
    }
    player->play();
    ui->drum5->setStyleSheet("border-image: url(:/pic/pic/drum5_2.jpg);border-radius: 10px;");
}


void MainWindow::on_drum6_pressed()
{
    QMediaPlayer *player=new QMediaPlayer;
    switch(drumset){
    case 1:{
         player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum6.wav")));
         break;
    }
    case 2:{
        player->setMedia(QMediaContent(QUrl("qrc:/media/sound/drum6_2.wav")));
        break;
    }
    }
    player->play();
    ui->drum6->setStyleSheet("border-image: url(:/pic/pic/drum6_2.jpg);border-radius: 10px;");
}


void MainWindow::on_drum3_released()
{
    ui->drum3->setStyleSheet("border-image: url(:/pic/pic/drum3_1.png);border-radius: 10px;");
}


void MainWindow::on_drum5_released()
{
    ui->drum5->setStyleSheet("border-image: url(:/pic/pic/drum5_1.jpg);border-radius: 10px;");
}


void MainWindow::on_drum6_released()
{
    ui->drum6->setStyleSheet("border-image: url(:/pic/pic/drum6.jpg);border-radius: 10px;");
}

void MainWindow::on_btn_C3_pressed()
{
    isActive[12]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/C3.wav")));//实测wav文件比mp3延迟低
    player->play();
    ui->btn_C3->setStyleSheet("QPushButton{background-color: rgb(245, 245, 245);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_C3_released()
{
    isActive[12]=0;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_C3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_C3up_pressed()
{
    isActive[13]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/C3up.wav")));
    player->play();
    ui->btn_C3up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}

void MainWindow::on_btn_C3up_released()
{
    isActive[13]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_C3up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D3_pressed()
{
    isActive[14]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/D3.wav")));
    player->play();
    ui->btn_D3->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");
}


void MainWindow::on_btn_D3_released()
{
    isActive[14]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_D3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D3up_pressed()
{
    isActive[15]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/D3up.wav")));
    player->play();
    ui->btn_D3up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D3up_released()
{
    isActive[15]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_D3up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_E3_pressed()
{
    isActive[16]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/E3.wav")));
    player->play();
    ui->btn_E3->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}

void MainWindow::on_btn_E3_released()
{
    isActive[16]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_E3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_F3_pressed()
{
    isActive[17]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/F3.wav")));
    player->play();
    ui->btn_F3->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_F3_released()
{
    isActive[17]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_F3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}

void MainWindow::on_btn_F3up_pressed()
{
    isActive[18]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/F3up.wav")));
    player->play();
    ui->btn_F3up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_F3up_released()
{
    isActive[18]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_F3up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G3_pressed()
{
    isActive[19]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/G3.wav")));
    player->play();
     ui->btn_G3->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G3_released()
{
    isActive[19]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_G3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}

void MainWindow::on_btn_G3up_released()
{
    isActive[20]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_G3up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G3up_pressed()
{
    isActive[20]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/G3up.wav")));
    player->play();
    ui->btn_G3up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}



void MainWindow::on_btn_A3_pressed()
{
    isActive[21]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/A3.wav")));
    player->play();
     ui->btn_A3->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}



void MainWindow::on_btn_A3_released()
{
    isActive[21]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_A3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}



void MainWindow::on_btn_A3up_pressed()
{
    isActive[22]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/A3up.wav")));
    player->play();
    ui->btn_A3up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_A3up_released()
{
    isActive[22]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_A3up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_B3_pressed()
{
    isActive[23]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/B3.wav")));
    player->play();
     ui->btn_B3->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_B3_released()
{
    isActive[23]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_B3->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}
void MainWindow::on_btn_C4_pressed()
{
    isActive[24]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/C4.wav")));//实测wav文件比mp3延迟低
    player->play();
    ui->btn_C4->setStyleSheet("QPushButton{background-color: rgb(245, 245, 245);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");
}
void MainWindow::on_btn_C4_released()
{
    isActive[24]=0;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_C4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");
}

void MainWindow::on_btn_C4up_pressed()
{
    isActive[25]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/C4up.wav")));
    player->play();
    ui->btn_C4up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_C4up_released()
{
    isActive[25]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_C4up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D4_pressed()
{
    isActive[26]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/D4.wav")));
    player->play();
    ui->btn_D4->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D4_released()
{
    isActive[26]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_D4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D4up_pressed()
{
    isActive[27]=1;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    QMediaPlayer *player=new QMediaPlayer;
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/D4up.wav")));
    player->play();
    ui->btn_D4up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_D4up_released()
{
    isActive[27]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_D4up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_E4_pressed()
{
    isActive[28]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));

    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/E4.wav")));
    player->play();
     ui->btn_E4->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_E4_released()
{
    isActive[28]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_E4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");
}


void MainWindow::on_btn_F4_pressed()
{
    isActive[29]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/F4.wav")));
    player->play();
     ui->btn_F4->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_F4_released()
{
    isActive[29]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_F4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_F4up_pressed()
{
    isActive[30]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/F4up.wav")));
    player->play();
    ui->btn_F4up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_F4up_released()
{
    isActive[30]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_F4up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G4_pressed()
{
    isActive[31]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/G4.wav")));
    player->play();
     ui->btn_G4->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G4_released()
{
    isActive[31]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_G4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G4up_pressed()
{
    isActive[32]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/G4up.wav")));
    player->play();
      ui->btn_G4up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_G4up_released()
{
    isActive[32]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_G4up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_A4_pressed()
{
    isActive[33]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/A4.wav")));
    player->play();
     ui->btn_A4->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_A4_released()
{
    isActive[33]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_A4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_A4up_pressed()
{
    isActive[34]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/A4up.wav")));
    player->play();
      ui->btn_A4up->setStyleSheet("QPushButton{background-color: rgb(76, 76, 76);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_A4up_released()
{
    isActive[34]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_A4up->setStyleSheet("QPushButton{background-color: rgb(54, 54, 54);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");
}


void MainWindow::on_btn_B4_pressed()
{
    isActive[35]=1;
    QMediaPlayer *player=new QMediaPlayer;
    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    player->setMedia(QMediaContent(QUrl("qrc:/media/sound/B4.wav")));
    player->play();
     ui->btn_B4->setStyleSheet("QPushButton{background-color: rgb(240, 240, 240);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}


void MainWindow::on_btn_B4_released()
{
    isActive[35]=0;

    emit mySignal();
    connect(this,SIGNAL(mySignal()),scr,SLOT(scrSlot()));
    ui->btn_B4->setStyleSheet("QPushButton{background-color: rgb(234, 234, 234);border:2px groove gray;border-radius:10px;padding:2px 4px;border-style: outset;}");

}

